using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using CodeFx.Web;
using CodeFx.Web.UI;
using System.Threading;

namespace Code1
{
    public class PageWithRequest : PageWithAttribute<Themes>
    {
        protected override void InitializeCulture()
        {
            if (CultureHelper.IsCultureSet)
            {
                string culture = CultureHelper.Culture ;
                
                Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(culture);
                Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(culture);
            }
            base.InitializeCulture();

        }

        protected override void Page_Load(object sender, EventArgs e)
        {
            base.Page_Load(sender, e);

            if (!Page.IsPostBack)
            {
               if (IsRequestedAttribute.GetData(this.GetType()).IsRequested
                    && (Request.QueryString.Count > 0))
               {

                        string Action = Request.QueryString[ConstantesBase.Request.Action];
                        if (!string.IsNullOrEmpty(Action))
                        {
                            /// Do something with the persistance
                            PersistanceMail.Current.SetObject(null); 
                        }

                }
            }
            }
        }
    }
